<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%><%@taglib
	uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%@ page
	language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Share With Me</title>
</head>
<body>
	<!DOCTYPE html >
	<!--  Website template by freewebsitetemplates.com  -->
<html>

<head>
<title>Minimalistic Web Template</title>
<meta charset="iso-8859-1" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
		<link href="css/ie6.css" rel="stylesheet" type="text/css" />
	<![endif]-->
<!--[if IE 7]>
        <link href="css/ie7.css" rel="stylesheet" type="text/css" />  
	<![endif]-->
<style type="text/css">
.news-title {
	font-weight: bold;
	float: left;
}

.news-short-description {
	font-size: 13px;
	margin-left: 40px;
	margin-bottom: 10px;
	border-bottom: solid #ffffff 1px;
}

.view-count {
	font-size: 12px;
	margin-left: 40px;
}
</style>
</head>

<body>
	<div id="background">
		<div id="page">

			<div class="header">
				<div class="footer">
					<div class="body">

						<!-- include Menu -->
						<!-- include Menu -->
						<jsp:include page="Menu.jsp" flush="True">
							<jsp:param name="page_call" value="ShareWithMe" />
						</jsp:include>


						<div id="content">
							<img src="images/cotton-flower.jpg" width="726" height="546"
								alt="" title="">
							<div class="pagetitlebar">
								Share With Me. <span
									style="margin-left: 350px; font-size: 15px;"> <c:if
										test="${sessionScope.User!= null}">
										<a href="UpdateNews.jsp" style="color: #ffffff">Update
											news</a>
									</c:if>
								</span>
							</div>

							<div class="pagecontent">
								<sql:query var="db" dataSource="jdbc/sharewithme">
												SELECT btypeid, btypename from sharewithme.tbbooktype 
											</sql:query>
								<c:forEach var="booktype" items="${db.rows}">
									<div class="news-title">ห้อง ${booktype.btypename}</div>
									<br>
									<sql:query dataSource="jdbc/sharewithme" var="rs">
										select bisbn, bnamethai, bnameeng, bwriter, bpublishing, 
										bedition,btranslate, bprice , countview, countcomment, countrate
										FROM  sharewithme.tbbooks book , sharewithme.tbtopview topview
										where btypeid =  ${booktype.btypeid}
                    					and book.bisbn = topview.isbn
                    					order by countview desc
                    					limit 0, 3
									</sql:query>
									<c:forEach items="${rs.rows }" var="book">
										<div class="view-count" style="width: 613px;">
											: <a href="ShareWithMe_detail.jsp?bisbn=${book.bisbn }">${book.bnamethai}</a>
											by ${book.bwriter}
										</div>

									</c:forEach>
									<div class="view-count" style="width: 613px;">
									<a href="BookTypeDetail.jsp?btypeid=${booktype.btypeid }">more...</a></div>
									<div class="news-short-description"></div>
</c:forEach>

									
								
							</div>

							<p style="height: 350px;">&nbsp;</p>
						</div>
								
					</div>
				</div>
				<div class="shadow">&nbsp;</div>
			</div>
		</div>
	</div>
</body>
</html>